package com.sx.zongzhi.net;

import com.sx.zongzhi.MyApplication;
import java.io.File;
import okhttp3.Cache;


/**
 * Created by XZY on 2017/11/20.
 */

public class CacheUtil {

    private static final int HTTP_RESPONSE_DISK_CACHE_MAX_SIZE = 10 * 1024 * 1024;


    public static Cache getCache() {
        //设置缓存路径
        final File baseDir = MyApplication.context.getExternalCacheDir();
        File cacheFile=new File(baseDir, "HttpResponseCache");
        return new Cache(cacheFile, HTTP_RESPONSE_DISK_CACHE_MAX_SIZE);
    }

}
